/*     */ package eos.moe.dragoncore;
/*     */ import java.awt.Color;
/*     */ import java.awt.Font;
/*     */ import java.awt.FontMetrics;
/*     */ import java.awt.Graphics2D;
/*     */ import java.awt.GraphicsEnvironment;
/*     */ import java.awt.RenderingHints;
/*     */ import java.awt.image.BufferedImage;
/*     */ import java.io.InputStream;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.BufferBuilder;
/*     */ import net.minecraft.client.renderer.GlStateManager;
/*     */ import net.minecraft.client.renderer.Tessellator;
/*     */ import net.minecraft.client.renderer.texture.TextureUtil;
/*     */ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ 
/*     */ public class pj {
/*  23 */   private static int u = 512;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  34 */   public float i = 1.0F;
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void v(float f1, float f2, float f3, float f4) {
/*  40 */     this.w = f1;
/*  41 */     this.q = f2;
/*  42 */     this.g = f3;
/*  43 */     this.i = f4;
/*     */   }
/*     */ 
/*     */   
/*     */   public pj(Font font, float f) {
/*  48 */     this.c = new ArrayList<>();
/*  49 */     this.r = new nd<>(100);
/*  50 */     this.f = new HashMap<>();
/*  51 */     this.s = new ArrayList<>();
/*  52 */     this.l = 1;
/*  53 */     this.t = (Graphics2D)(new BufferedImage(1, 1, 2)).getGraphics();
/*  54 */     this.d = 1.0F;
/*  55 */     this.z = 167;
/*  56 */     this.m = font;
/*  57 */     this.d = f;
/*  58 */     this.t.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
/*  59 */     this.l = this.t.getFontMetrics(font).getHeight();
/*     */   }
/*     */   
/*     */   public pj(ResourceLocation resourceLocation, int i, float f) {
/*  63 */     this.c = new ArrayList<>();
/*  64 */     this.r = new nd<>(100);
/*  65 */     this.f = new HashMap<>();
/*  66 */     this.s = new ArrayList<>();
/*  67 */     this.l = 1;
/*  68 */     this.t = (Graphics2D)(new BufferedImage(1, 1, 2)).getGraphics();
/*  69 */     this.d = 1.0F;
/*  70 */     this.z = 167;
/*     */ 
/*     */     
/*  73 */     InputStream inputStream = null;
/*     */     try {
/*  75 */       inputStream = Minecraft.func_71410_x().func_110442_L().func_110536_a(resourceLocation).func_110527_b();
/*  76 */       GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
/*  77 */       Font font = Font.createFont(0, inputStream);
/*  78 */       graphicsEnvironment.registerFont(font);
/*     */       
/*  80 */       this.m = font.deriveFont(0, i);
/*  81 */       this.d = f;
/*  82 */       this.t.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
/*  83 */       this.l = this.t.getFontMetrics(font).getHeight();
/*  84 */     } catch (Exception exception) {
/*  85 */       exception.printStackTrace();
/*     */     } 
/*     */   }
/*     */   
/*     */   public void v(char c) {
/*  90 */     this.z = c;
/*     */   }
/*     */   
/*     */   public void z(String str, float f1, float f2) {
/*  94 */     if (this.m == null) {
/*     */       return;
/*     */     }
/*  97 */     eos/moe/dragoncore/td eos/moe/dragoncore/td = v(str);
/*     */     
/*  99 */     GlStateManager.func_179131_c(this.w, this.q, this.g, this.i);
/* 100 */     GlStateManager.func_179147_l();
/* 101 */     GlStateManager.func_179094_E();
/* 102 */     GlStateManager.func_179109_b(f1, f2, 0.0F);
/* 103 */     GlStateManager.func_179152_a(this.d, this.d, 1.0F);
/* 104 */     float f = 0.0F;
/* 105 */     for (eos/moe/dragoncore/sh eos/moe/dragoncore/sh : eos/moe/dragoncore/td.q) {
/*     */       
/* 107 */       if (eos/moe/dragoncore/sh.m != eos/moe/dragoncore/ok.f) {
/* 108 */         if (eos/moe/dragoncore/sh.m == eos/moe/dragoncore/ok.i) {
/* 109 */           GlStateManager.func_179131_c(this.w, this.q, this.g, this.i); continue;
/*     */         } 
/* 111 */         if (eos/moe/dragoncore/sh.m != eos/moe/dragoncore/ok.s) {
/*     */           continue;
/*     */         }
/* 114 */         GlStateManager.func_179131_c((eos/moe/dragoncore/sh.l >> 16 & 0xFF) / 255.0F, (eos/moe/dragoncore/sh.l >> 8 & 0xFF) / 255.0F, (eos/moe/dragoncore/sh.l & 0xFF) / 255.0F, this.i);
/*     */         continue;
/*     */       } 
/* 117 */       if (eos/moe/dragoncore/sh.q != null) {
/* 118 */         mca.eos/moe/dragoncore/xfa eos/moe/dragoncore/xfa = eos/moe/dragoncore/sh.q;
/* 119 */         hw.v(eos/moe/dragoncore/sh.q.v());
/* 120 */         GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, this.i);
/* 121 */         sa.v(f, 0.0F, eos/moe/dragoncore/xfa.c() / this.d, eos/moe/dragoncore/xfa.s() / this.d, eos/moe/dragoncore/xfa
/* 122 */             .k() / this.d, eos/moe/dragoncore/xfa.d() / this.d, eos/moe/dragoncore/xfa
/* 123 */             .y() / this.d, eos/moe/dragoncore/xfa.t() / this.d);
/* 124 */         GlStateManager.func_179131_c(this.w, this.q, this.g, this.i);
/*     */       } else {
/* 126 */         GlStateManager.func_179144_i(eos/moe/dragoncore/sh.w);
/* 127 */         v(f, 0.0F, eos/moe/dragoncore/sh.t * v(), eos/moe/dragoncore/sh.d * v(), eos/moe/dragoncore/sh.i * v(), eos/moe/dragoncore/sh.z * v());
/*     */       } 
/* 129 */       f += eos/moe/dragoncore/sh.i * v();
/*     */     } 
/*     */     
/* 132 */     GlStateManager.func_179084_k();
/* 133 */     GlStateManager.func_179121_F();
/* 134 */     GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void v(String str, float f1, float f2) {
/* 279 */     z(str, f1 - z(str) / 2.0F, f2);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void v(float f1, float f2, float f3, float f4, float f5, float f6) {
/* 306 */     float f7 = 0.00390625F;
/* 307 */     float f8 = 0.00390625F;
/* 308 */     int i = 0;
/* 309 */     BufferBuilder bufferBuilder = Tessellator.func_178181_a().func_178180_c();
/* 310 */     bufferBuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
/* 311 */     bufferBuilder.func_78914_f();
/* 312 */     bufferBuilder.func_181662_b(f1, (f2 + f6), i).func_187315_a((f3 * f7), ((f4 + f6) * f8)).func_181675_d();
/* 313 */     bufferBuilder.func_181662_b((f1 + f5), (f2 + f6), i).func_187315_a(((f3 + f5) * f7), ((f4 + f6) * f8)).func_181675_d();
/* 314 */     bufferBuilder.func_181662_b((f1 + f5), f2, i).func_187315_a(((f3 + f5) * f7), (f4 * f8)).func_181675_d();
/* 315 */     bufferBuilder.func_181662_b(f1, f2, i).func_187315_a((f3 * f7), (f4 * f8)).func_181675_d();
/* 316 */     Tessellator.func_178181_a().func_78381_a();
/*     */   }
/*     */   
/*     */   public int z(String str) {
/* 320 */     if (this.m == null) {
/* 321 */       return 0;
/*     */     }
/* 323 */     eos/moe/dragoncore/td eos/moe/dragoncore/td = v(str);
/* 324 */     return (int)(eos/moe/dragoncore/td.i * this.d * v());
/*     */   }
/*     */   
/*     */   public int v(String str) {
/* 328 */     if (str == null || str.trim().isEmpty()) {
/* 329 */       return (int)(this.l * this.d * v());
/*     */     }
/* 331 */     eos/moe/dragoncore/td eos/moe/dragoncore/td = v(str);
/* 332 */     return Math.max(1, (int)(eos/moe/dragoncore/td.w * this.d * v()));
/*     */   }
/*     */ 
/*     */   
/*     */   public String v(String str, int i, boolean bool) {
/* 337 */     if (this.m == null) {
/* 338 */       return str.substring(1);
/*     */     }
/* 340 */     StringBuilder stringBuilder = new StringBuilder();
/* 341 */     int j = 0;
/* 342 */     int k = bool ? (str.length() - 1) : 0;
/* 343 */     int m = bool ? -1 : 1;
/* 344 */     boolean bool1 = false;
/* 345 */     boolean bool2 = false;
/* 346 */     mca mca = mca.q; int n;
/* 347 */     for (n = k; n >= 0 && n < str.length() && j < i; n += m) {
/* 348 */       char c = str.charAt(n);
/*     */       
/* 350 */       if (n + 1 != str.length() && c == '§' && mca.v(str.charAt(n + 1)) != null && mca.v(str.charAt(n + 1)).v()) {
/* 351 */         j = (int)(j + mca.v(str.charAt(n + 1)).k());
/* 352 */         if (bool2) {
/* 353 */           j++;
/*     */         }
/* 355 */       } else if (n + 1 != str.length() && c == '§' && str.charAt(n + 1) == '#') {
/* 356 */         n += 7;
/*     */       } else {
/* 358 */         int i1 = (v(c)).i;
/* 359 */         if (bool1) {
/* 360 */           bool1 = false;
/* 361 */           if (v(c, true)) {
/* 362 */             j += v(c, true);
/* 363 */             if (bool2) {
/* 364 */               j++;
/*     */             }
/*     */           }
/* 367 */           else if (c != 'l' && c != 'L') {
/* 368 */             if (c == 'r' || c == 'R') {
/* 369 */               bool2 = false;
/*     */             }
/*     */           } else {
/* 372 */             bool2 = true;
/*     */           }
/*     */         
/* 375 */         } else if (i1 < 0) {
/* 376 */           bool1 = true;
/*     */         } else {
/* 378 */           j += v(c, true);
/* 379 */           if (bool2) {
/* 380 */             j++;
/*     */           }
/*     */         } 
/*     */       } 
/* 384 */       if (j > i) {
/*     */         break;
/*     */       }
/*     */       
/* 388 */       if (bool) {
/* 389 */         stringBuilder.insert(0, c);
/*     */       } else {
/* 391 */         stringBuilder.append(c);
/*     */       } 
/*     */     } 
/*     */     
/* 395 */     return stringBuilder.toString();
/*     */   }
/*     */   
/*     */   public boolean v(char c, boolean bool) {
/* 399 */     mca.eos/moe/dragoncore/xfa eos/moe/dragoncore/xfa = mca.q.v(c);
/* 400 */     if (eos/moe/dragoncore/xfa != null && (!eos/moe/dragoncore/xfa.v() || bool)) {
/* 401 */       return true;
/*     */     }
/* 403 */     return false;
/*     */   }
/*     */   
/*     */   public int v(char c, boolean bool) {
/* 407 */     mca.eos/moe/dragoncore/xfa eos/moe/dragoncore/xfa = mca.q.v(c);
/* 408 */     if (eos/moe/dragoncore/xfa != null && (!eos/moe/dragoncore/xfa.v() || bool)) {
/* 409 */       return (int)eos/moe/dragoncore/xfa.v() + 1;
/*     */     }
/* 411 */     return (v(c)).i;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void v() {
/* 419 */     for (eos/moe/dragoncore/df eos/moe/dragoncore/df : this.s) {
/* 420 */       GlStateManager.func_179150_h(eos/moe/dragoncore/df.d);
/*     */     }
/* 422 */     this.r.clear();
/*     */   }
/*     */   
/*     */   public String v() {
/* 426 */     return this.m.getFontName();
/*     */   }
/*     */   private List<Font> c; private LinkedHashMap<String, eos/moe/dragoncore/td> r; private Map<Character, eos/moe/dragoncore/sh> f; private List<eos/moe/dragoncore/df> s; private Font m;
/*     */   private int l;
/* 430 */   private static List<Font> j = Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()); private Graphics2D t; public float d; private int z; private float w;
/*     */   private float q;
/*     */   private float g;
/*     */   
/* 434 */   enum eos/moe/dragoncore/ok { f,
/* 435 */     s,
/* 436 */     m,
/* 437 */     l,
/* 438 */     t,
/* 439 */     d,
/* 440 */     z,
/* 441 */     i,
/* 442 */     w,
/* 443 */     q; }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   class eos/moe/dragoncore/df
/*     */   {
/*     */     public int l;
/*     */ 
/*     */     
/*     */     public int t;
/*     */ 
/*     */     
/* 456 */     public int d = GlStateManager.func_179146_y();
/* 457 */     public BufferedImage z = new BufferedImage(512, 512, 2);
/* 458 */     public Graphics2D i = (Graphics2D)this.z.getGraphics(); public boolean w;
/* 459 */     public String q = UUID.randomUUID().toString();
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*     */     public eos/moe/dragoncore/df(pj pj1) {}
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   class eos/moe/dragoncore/sh
/*     */   {
/* 474 */     public pj.eos/moe/dragoncore/ok m = pj.eos/moe/dragoncore/ok.f;
/* 475 */     public int l = -1; public int t; public int d;
/*     */     public int z;
/*     */     public int i;
/*     */     public int w;
/*     */     public mca.eos/moe/dragoncore/xfa q;
/*     */     
/*     */     public eos/moe/dragoncore/sh(pj pj1) {} }
/*     */   
/*     */   class eos/moe/dragoncore/td { public int i;
/*     */     public int w;
/* 485 */     public List<pj.eos/moe/dragoncore/sh> q = new ArrayList<>();
/*     */     
/*     */     public eos/moe/dragoncore/td(pj pj1) {} }
/*     */ 
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\pj.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */